package com.xilihui.xlh.business.requests;

import android.content.Context;

import com.xilihui.xlh.business.entities.JoinStoreEntity;
import com.xilihui.xlh.core.app.BaseEntity;
import com.xilihui.xlh.core.http.HttpManager;
import com.xilihui.xlh.core.util.SPUtil;

import rx.Observable;


/**
 * Created by Administrator on 2018/7/5.
 */

public class JoinShopRequest {
    
    public static JoinShopService service = HttpManager.getRetrofit().create(JoinShopService.class);

    /**
     * 加入门店
     * @param context
     * @param id
     * @return
     */
    public static Observable<BaseEntity> joinShop(Context context,String id){
        String access_token = (String) SPUtil.get(context,SPUtil.TOKEN,"");
        return service.joinShop(access_token,id);
    }

    /**
     * 获取加入的门店
     * @param context
     * @param page
     * @return
     */
    public static Observable<JoinStoreEntity> getShop(Context context, int page){
        String access_token = (String)SPUtil.get(context,SPUtil.TOKEN,"");
        return service.getShop(access_token,page);
    }
    
}
